package com.xusl.spring.service.impl;

import com.xusl.spring.dao.UserDao;
import com.xusl.spring.model.User;
import com.xusl.spring.service.UserService;

import java.util.List;

/**
 * @Author: xusl
 * @Date: 2021/8/3 10:55 下午
 */
public class UserServiceImpl implements UserService {

    private UserDao userDao;

    // 通过构造方法给userDao属性赋值  也可以用set方法
    // public UserServiceImpl(UserDao userDao) {
    //     this.userDao = userDao;
    // }


    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    @Override
    public List<User> queryAll() {
        System.out.println("执行业务方法");
        return userDao.queryAll();
    }
}
